<?php

/**
 * Gallery Backend Index
 * 
 * @package Bd Gallery
 * @author Bebliuc George Cristian
 * @author Gianfranco Liporace
 * @copyright 2008-2010
 * @version 1.3
 * @access public
 * @permisions Modify, Redistribute but leave the credits alive :P
 * @use Noncommercial, for commercial use, please contact me at bebliuc.george@gmail.com, it's for free, but I need to know
 * 
 */
	$albums = Category::findAllFrom('Category');
?>
<h1><?php echo __('Albums'); ?></h1>
<table class="index">
    <thead>
        <th>Id</th>
        <th>Gallery</th>
        <th>Actions</th>
    </thead>
<?php foreach ($albums as $album) { ?>
    <tr class="snippet node <?php echo odd_even(); ?>">
        <td> <?php echo $album->getId(); ?> </td>
        <td> <img align="middle" alt="snippet-icon" src="<?php echo GALLERY_ROOT; ?>/images/gallery.png" />
             <a href="<?php echo get_url('plugin/gallery/view_album/' . $album->getId()); ?>"><?php echo $album->getName(); ?></a></td>
        <td> 
             <a href="<?php echo get_url('plugin/gallery/delete/' . $album->getId()); ?>" onclick="return confirm('<?php echo
__('Are you sure you wish to delete this album?'); ?>');">
                 <img src="<?php echo GALLERY_ROOT; ?>/images/delete.png" alt="remove icon" />
             </a>
             <a href="<?php echo get_url('plugin/gallery/edit_album/' . $album->getId()) ?>">
                 <img src="<?php echo GALLERY_ROOT; ?>/images/edit.png" alt="edit icon" />
             </a>
        </td>
    </tr>

<?php } ?>
</table>